<a href="javascript: <?php echo $oSContainer->getOSRequest()->getRequestFunctionName() ?>()">List Viewer friends</a>
<div id="viewer_friends_div"></div>

<script type="text/javascript">

  function <?php echo $oSContainer->getResponseFunctionName() ?>(<?php echo $oSContainer->getResponseDataName() ?>) {
    var html ='';
    <?php echo $oSContainer->getOSGadget()->loading('viewer_friends_div','Loading...'); ?>

    <?php echo $viewer_friends->startForeachFriends() ?>
      var thumb = <?php echo $friend->getThumbnailURL() ?>
      var profile = <?php echo $friend->getProfileURL() ?>
      html += '<a href="' + profile + '" target="_top" style="float:left">' +
        '<img src="' + thumb + '"/>' +
        '</a>'; 
    <?php echo $viewer_friends->endForeachFriends() ?>

    document.getElementById('viewer_friends_div').innerHTML = html;
    <?php echo $oSContainer->getOSGadget()->adjustHeight(); ?>
  }
</script>
